<?php
/**
 * Created by PhpStorm.
 * User: Inhere
 * Date: 2015/2/11
 * Use : ...
 * File: AbstractAction.php
 */

namespace ulue\core\action;

use ulue\core\abstracts\AbstractBase;

abstract class AbstractAction extends AbstractBase
{
    /**
     * 控制器动作方法名后缀
     * @var string
     */
    private $suffix;

    /**
     * 完整的控制器动作方法名
     * @var string
     */
    private $methodName;


    /**
     * Gets the 完整的控制器动作方法名.
     *
     * @return string
     */
    public function getMethodName()
    {
        return $this->methodName ? : $this->name . ucfirst($this->suffix);
    }

    /**
     * Sets the 完整的控制器动作方法名.
     *
     * @param string $methodName the method name
     *
     * @return self
     */
    public function setMethodName($methodName)
    {
        $this->methodName = $methodName;

        return $this;
    }

    /**
     * Gets the 控制器动作方法名后缀.
     *
     * @return string
     */
    public function getSuffix()
    {
        return $this->suffix;
    }

    /**
     * Sets the 控制器动作方法名后缀.
     *
     * @param string $suffix the suffix
     *
     * @return self
     */
    public function setSuffix($suffix)
    {
        $this->suffix = $suffix ? ucfirst($suffix) : '';

        return $this;
    }
}//end